package com.jm.jisho;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class JJishoActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.home_layout);
   
    /**
     * Creating all buttons instances
     * */
    // Dashboard News feed button
    Button btn_newsfeed = (Button) findViewById(R.id.btn_news_feed);

    // Dashboard Friends button
    Button btn_friends = (Button) findViewById(R.id.btn_friends);

    // Dashboard Messages button
    Button btn_messages = (Button) findViewById(R.id.btn_messages);

    // Dashboard Places button
    Button btn_places = (Button) findViewById(R.id.btn_places);

    // Dashboard Events button
    Button btn_events = (Button) findViewById(R.id.btn_events);

    // Dashboard Photos button
    Button btn_photos = (Button) findViewById(R.id.btn_photos);

    /**
     * Handling all button click events
     * */

    // Listening to News Feed button click
    btn_newsfeed.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            // Launching OCR Activity
            Intent i = new Intent(getApplicationContext(), OCRActivity.class);
            startActivity(i);
        }
    });

   // Listening Dictionary button click
    btn_friends.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            // Launching News Feed Screen
            Intent i = new Intent(getApplicationContext(), DictionaryActivity.class);
            startActivity(i);
        }
    });

    // Listening Settings button click
    btn_messages.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            // Launching News Feed Screen
            Intent i = new Intent(getApplicationContext(), SettingsActivity.class);
            startActivity(i);
        }
    });

    // Listening to Places button click
    //TODO FIXME
    btn_places.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            // Launching News Feed Screen
            Intent i = new Intent(getApplicationContext(), SettingsActivity.class);
            startActivity(i);
        }
    });

    // Listening to History button click
    btn_events.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            // Launching News Feed Screen
            Intent i = new Intent(getApplicationContext(), HistoryActivity.class);
            startActivity(i);
        }
    });

    // Listening to About button click
    btn_photos.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            // Launching News Feed Screen
            Intent i = new Intent(getApplicationContext(), AboutActivity.class);
            startActivity(i);
        }
    });
    }
}